home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 December / Chip_2001-12_cd1.bin / zkuste / tuning / download / xteq / setup.exe / {app} / plugins / XQ Yahoo Messenger 3.xpl < prev    next >
Text File  |  2001-01-04  |  6KB  |  170 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 5.0"
  2. "TYPE"="8"
  3. "COUNT"="3"
  4. "UIPATH"="Internet\Instant Messaging\Yahoo Messenger"
  5. "NAME"="Custom Status Messages"
  6. "LANGUAGE"="VBScript"
  7. "TEXT 1"="New status..."
  8. "TEXT 2"="Edit status..."
  9. "TEXT 3"="Delete status"
  10. "DESCRIPTION 1"="If you're bored with the status messages Yahoo! gives you by default (Be Right Back, Busy), you can create your own."
  11. "DESCRIPTION 2"="To create a new status, click 'New Status', type in a new message to describe your status (for example Drunk, Insane, Can't Be Bothered), and click OK. Then on the next screen type "0" (without the quotes) if you want this to be an 'active' status and "1" (without the quotes) if you want this to be a 'busy' status. Then click OK."
  12. "DESCRIPTION 3"="You can also edit or delete entries you've already made."
  13. "DESCRIPTION 4"="Notes: You are limited to 5 custom status messages. If you have an older version of Yahoo! Messenger, the settings will affect all users; in more recent versions the settings will only affect the current user."
  14. "DESCRIPTION 5"="Yahoo! Messenger may be obtained at http://messenger.yahoo.com/."
  15. "COMMENT 1"="Thanks to CptSiskoX (cptsisko@mailandnews.com), AXCEL216, (axcel216@aol.com) and Jesse L Zufall (jzufall@yahoo.com) for this tip."
  16. "VERSION"="1.11"
  17. "AUTHOR"="Neil R. Turner (totalxs@hotmail.com) for Xteq Systems"
  18. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved."
  19. "CONTACTURL"="http://www.128moorlane.freeserve.co.uk/"
  20.  
  21. 'Declaration of some constants
  22. a="HKCU\Software\Yahoo\Pager\"
  23.  
  24. 'Called when the Plugin is started
  25. SUB Plugin_Initialize
  26.  k=RegPathExists(a)
  27.  if k=false then
  28.   Call Disable()
  29.  else
  30.   d=RegPathExists(a & "Profiles\")
  31.   if d=true then
  32.    b=RegValueExists(a & "Yahoo! User ID")
  33.    if b=true then
  34.     c=RegReadValue(a & "Yahoo! User ID")
  35.     g=a & "Profiles\" & c & "\"
  36.    end if
  37.   else
  38.    g=a
  39.   end if
  40.   Call ReadMsg(1,g)
  41.   Call ReadMsg(2,g)
  42.   Call ReadMsg(3,g)
  43.   Call ReadMsg(4,g)
  44.   Call ReadMsg(5,g)
  45.  end if
  46. END SUB
  47.  
  48. 'Called when the Plugin should validate the Data the user has entered
  49. SUB Plugin_CheckData(ElementIndex)
  50. END SUB
  51.  
  52. 'Called when the Plugin should apply the changes
  53. SUB Plugin_Apply(ElementIndex,ElementSubIndex)
  54.  d=RegPathExists(a & "Profiles\")
  55.  if d=true then
  56.   b=RegValueExists(a & "Yahoo! User ID")
  57.   if b=true then
  58.    c=RegReadValue(a & "Yahoo! User ID")
  59.    g=a & "Profiles\" & c & "\"
  60.   end if
  61.  else
  62.   g=a
  63.  end if
  64.  if ElementIndex=1 then ' New entry
  65.   if RegValueExists(g & "Custom Msgs\1")=true AND RegValueExists(g & "Custom Msgs\2")=true AND RegValueExists(g & "Custom Msgs\3")=true AND RegValueExists(g & "Custom Msgs\4")=true AND RegValueExists(g & "Custom Msgs\5")=true then
  66.    Call MsgError("You cannot have more than 5 entries!")
  67.   else
  68.    ' Firstly, we need to find out which value is free (either 1, 2, 3, 4 or 5)
  69.    if RegValueExists(g & "Custom Msgs\1")=false then
  70.     ' We can now use the first value
  71.     Call WriteMsg(1,g)
  72.    else
  73.     if RegValueExists(g & "Custom Msgs\2")=false then
  74.      ' OK, can we use the second value?
  75.      Call WriteMsg(2,g)
  76.     else
  77.      if RegValueExists(g & "Custom Msgs\3")=false then
  78.       ' Well what about the third value?
  79.       Call WriteMsg(3,g)
  80.      else
  81.       if RegValueExists(g & "Custom Msgs\4")=false then
  82.        ' Surely the fourth value?
  83.        Call WriteMsg(4,g)
  84.       else
  85.        if RegValueExists(g & "Custom Msgs\5")=false then
  86.         ' No! Not the fifth value! AAAAAHHHH!
  87.         Call WriteMsg(5,g)
  88.        else
  89.         Call MsgError("You cannot have more than 5 entries!")
  90.        end if ' 1 ..
  91.       end if ' 2 ..
  92.      end if ' 3 ..
  93.     end if ' 4 ..
  94.    end if ' 5 ..
  95.   end if '6 !!! Oh well, it works...
  96.  else
  97.   if ElementSubIndex>0 then
  98.    if ElementIndex=2 then ' Edit status
  99.     Call WriteMsg(ElementSubIndex,g)
  100.    end if
  101.    if ElementIndex=3 then ' Delete Status
  102.     m=RegValueExists(g & "Custom Msgs\" & ElementSubIndex)
  103.     if m=true then
  104.      Call RegDeleteValue(g & "Custom Msgs\" & ElementSubIndex)
  105.     end if
  106.     m=RegValueExists(g & "Custom Msgs\" & ElementSubIndex & "_DND")
  107.     if m=true then
  108.      Call RegDeleteValue(g & "Custom Msgs\" & ElementSubIndex & "_DND")
  109.     end if
  110.     Call SetUIElement(ElementSubIndex,"")
  111.    end if
  112.   else
  113.    Call MsgError("Please select an item first.")
  114.   end if
  115.  end if
  116. END SUB
  117.  
  118. 'Called when the Plugin is about to be removed from memory
  119. SUB Plugin_Terminate
  120. END SUB
  121.  
  122. 'User defined SUB's
  123. SUB WriteMsg(MsgID,UserID)
  124.  d=RegPathExists(a & "Profiles\")
  125.  if d=true then
  126.   b=RegValueExists(a & "Yahoo! User ID")
  127.   if b=true then
  128.    c=RegReadValue(a & "Yahoo! User ID")
  129.    g=a & "Profiles\" & c & "\"
  130.   end if
  131.  else
  132.   g=a
  133.  end if
  134.  l=RegReadValue(g & "Custom Msgs\" & MsgID)
  135.  y=InputWindow("1. Type a description of this status (for example Drunk, Insane, Can't Be Bothered) below",l,1)
  136.  if IsEmpty(y)=false then
  137.   Call RegWriteValue(g & "Custom Msgs\" & MsgID,y,1)
  138.   j=InputWindow("2. Type '0' if you want this to be an 'active' status, type '1' if you want this to be a 'busy' status.","0",1)
  139.   if IsEmpty(j)=false then
  140.    if j="1" then
  141.     Call RegWriteValue(g & "Custom Msgs\" & MsgID & "_DND",1,2)
  142.    else
  143.     Call RegWriteValue(g & "Custom Msgs\" & MsgID & "_DND",0,2)
  144.    end if
  145.    j=RegReadValue(g & "Custom Msgs\" & MsgID & "_DND")
  146.    if j=1 then
  147.     x=" (Busy)"
  148.    else
  149.     x=" (Active)"
  150.    end if
  151.    Call SetUIElement(MsgID,y & x)
  152.   end if
  153.  end if
  154.  
  155. END SUB
  156.  
  157. SUB ReadMsg(MsgID,UserID)
  158.  f=RegValueExists(UserID & "Custom Msgs\" & MsgID)
  159.  if f=true then
  160.   o=RegReadValue(UserID & "Custom Msgs\" & MsgID)
  161.   p=RegReadValue(UserID & "Custom Msgs\" & MsgID & "_DND")
  162.   if p=0 then
  163.    q="(Active)"
  164.   else
  165.    q="(Busy)"
  166.   end if
  167.   Call SetUIElement(MsgID,o & " " & q)
  168.  end if
  169. END SUB
  170.